<template>
  <div class="login-view">
    <div class="container">
      <div class="left">
        欢 迎
      </div>
      <div class="right">
        <div class="tab-control">
          <router-link active-class="selected" to="/loginView/login">登 录</router-link>
          <router-link active-class="selected" to="/loginView/register">注 册</router-link>
        </div>
        <div class="tab">
          <router-view></router-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'LoginView',
    mounted() {
      // 登录页面加载时，隐藏导航条内的登录注册按钮
      this.$bus.$emit('changeShowLogin', false)
    },
    beforeDestroy() {
      // 销毁登录页面前，显示导航条内的登录注册按钮
      this.$bus.$emit('changeShowLogin', true)
    }
  }
</script>

<style scoped>
  .login-view {
    height: 720px;
    background: url("~assets/img/banner.jpg") center center no-repeat;
    padding-top: 100px;
  }

  .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 0 130px 0 80px;
  }

  .left {
    color: #fff;
    font-size: 30px;
    font-weight: 700;
  }

  .right {
    width: 480px;
  }

  .tab-control {
    display: flex;
    align-items: center;
    height: 100px;
    background-color: #86a3b1;
    border-radius: 5px;
    padding-left: 60px;
  } 

  .tab-control a {
    display: inline-block;
    height: 40px;
    line-height: 40px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    border-radius: 40px;
    margin-right: 20px;
    padding: 0 30px;
  }

  .tab-control .selected {
    
    background-color: #fff;
    color: #86a3b1;
    
  }
</style>